home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-12-17 | 3.2 KB | 201 lines | [mlts/slnk] |
- @ORIGINATE
- @ANSWER
- !
- serreset 9600, 0, 8, 1
- !
- ! first recall the factory configuration, and get the modem in enhanced command state
- !
- settries 0
- matchclr
- @LABEL 1
- matchstr 1 3 "OK\13\10"
- matchstr 2 2 "ERROR\13\10"
- write "AT~&F0\13"
- matchread 20
- !
- @LABEL 2
- matchclr
- matchstr 1 3 "OK\13\10"
- write "AT&F0\13"
- matchread 20
- inctries
- iftries 2 59
- ! Modem is not responding, reset and send a break
- DTRClear
- pause 5
- DTRSet
- SBreak
- jump 1
- !
- ! Turn echo off, retrain after line is bad for 1 second, turn off flow control.
- !
- @LABEL 3
- matchclr
- matchstr 1 4 "OK\13\10"
- write "ATE0S123=20S50=6\13"
- matchread 30
- jump 59
- !
- ! Reset when DTR is dropped
- !
- @LABEL 4
- matchstr 1 5 "OK\13\10"
- write "ATS52=2\13"
- matchread 30
- jump 59
- !
- ! If speaker on flag is true, jump to label 8. Else turn off the speaker
- @LABEL 5
- ifstr 2 8 "1"
- matchstr 1 8 "OK\13\10"
- write "ATM0\13"
- matchread 30
- jump 59
- !
- ! The modem is ready so enable answering, or originate a call
- !
- @LABEL 8
- ifANSWER 30
- note "Dialing ^1" 3
- write "ATS0=0DT^1\13"
- !
- @LABEL 9
- matchstr 1 11 "CONNECT 1200\13\10"
- matchstr 2 12 "CONNECT 2400\13\10"
- matchstr 3 13 "CONNECT 4800\13\10"
- matchstr 4 14 "CONNECT 9600\13\10"
- matchstr 5 15 "CONNECT FAST\13\10"
- matchstr 6 50 "NO CARRIER\13\10"
- matchstr 7 50 "ERROR\13\10"
- matchstr 8 52 "NO DIALTONE\13\10"
- matchstr 9 53 "BUSY\13\10"
- matchstr 10 54 "NO ANSWER\13\10"
- matchread 700
- jump 59
- !
- @LABEL 11
- note "Communicating at 1200 bps." 2
- setspeed 1200
- jump 16
- !
- @LABEL 12
- note "Communicating at 2400 bps." 2
- setspeed 2400
- jump 16
- !
- @LABEL 13
- note "Communicating at 4800 bps." 2
- setspeed 4800
- jump 16
- !
- @LABEL 14
- note "Communicating at 9600 bps." 2
- setspeed 9600
- jump 16
- !
- @LABEL 15
- note "Communicating at 19.2 kbps." 2
- setspeed 19200
- !
- @LABEL 16
- ifANSWER 17
- pause 30
- @LABEL 17
- exit 0
- !
- ! @ANSWER
- ! Set up the modem to answer
- @LABEL 30
- write "ATS0=1\13"
- matchstr 1 31 "OK\13\10"
- matchread 30
- jump 59
- !
- @LABEL 31
- matchstr 1 32 "RING\13\10"
- matchstr 2 11 "CONNECT 1200\13\10"
- matchstr 3 12 "CONNECT 2400\13\10"
- matchstr 4 13 "CONNECT 4800\13\10"
- matchstr 5 14 "CONNECT 9600\13\10"
- matchstr 6 15 "CONNECT FAST\13\10"
- matchstr 7 50 "NO CARRIER\13\10"
- matchstr 8 50 "ERROR\13\10"
- matchstr 9 52 "NO DIALTONE\13\10"
- matchstr 10 53 "BUSY\13\10"
- matchstr 11 54 "NO ANSWER\13\10"
- matchread 700
- jump 31
- !
- @LABEL 32
- userhook 1
- note "Answering phone…" 2
- jump 31
- !
- ! 50: error messages
- !
- ! No carrier error
- @LABEL 50
- exit -6021
- !
- ! No dial tone error
- @LABEL 52
- exit -6020
- !
- ! Line busy error
- @LABEL 53
- exit -6022
- !
- ! No answer error
- @LABEL 54
- exit -6023
- !
- ! Modem error
- @LABEL 59
- exit -6019
- !
- ! Hang up the modem
- !
- @HANGUP
- @LABEL 60
- settries 0
- @LABEL 61
- matchclr
- matchstr 1 62 "OK\13\10"
- matchstr 2 62 "NO CARRIER\13\10"
- matchstr 3 62 "ERROR\13\10"
- write "ATH\13"
- matchread 30
- inctries
- iftries 3 62
- ! no response, try escape sequence
- write "+++"
- matchclr
- matchstr 1 61 "OK\13\10"
- matchread 15
- !
- ! No response from modem, toggle DTR
- !
- DTRClear
- pause 5
- DTRSet
- jump 61
- !
- ! Recall the factory settings
- !
- @LABEL 62
- pause 5
- matchclr
- matchstr 1 63 "OK\13\10"
- write "AT&F0\13"
- matchread 30
- ! turn off auto answer, set S51 so modem will check interface speed on next command
- @LABEL 63
- pause 5
- write "ATS0=0S51=255\13"
- matchstr 1 64 "OK\13\10"
- matchread 30
- !
- @LABEL 64
- exit 0
-
-